<%= link_to image_tag(
  url_for(:controller => :image, :action => size, :id => entity)),
  url, :onclick => onclick %>
